Mac os thrift旧版本安装爬坑指南
喜欢使用brew来进行一键安装:
对于安装最新新版本thrift,我们可以直接是用brew install thrift
使用brew search thrift;查看不同版本的thrift。然后brew install thrift@0.9.0
使用复杂brew方案进行安装。思路同时通过找到旧版本的thrift.rb。
- 将homebrew-core的git文件下载到本地。
- 通过查看Formula/thrift.rb的history。
git log 234b34ab1418bd42b14e73dbeea179f40ef1bec2 -- Formula/thrift.rb
找到旧版本的commit。
1
2
3
4
5commit 9d524e4850651cfedd64bc0740f1379b533f607d
Author: BrewTestBot <brew-test-bot@googlegroups.com>
Date: Thu Dec 29 18:54:26 2016 +0000
thrift: update 0.9.3 bottle.然后将链接
1
2
3https://github.com/Homebrew/homebrew-core/blob/{commit_id}/Formula/thrift.rb
即:
https://github.com/Homebrew/homebrew-core/blob/9d524e4850651cfedd64bc0740f1379b533f607d/Formula/thrift.rb点击页面上按钮“Raw”,获取文件内容
1
2
3https://raw.githubusercontent.com/Homebrew/homebrew-core/{commit_id}/Formula/thrift.rb
即:
https://raw.githubusercontent.com/Homebrew/homebrew-core/9d524e4850651cfedd64bc0740f1379b533f607d/Formula/thrift.rb在命令行上 brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9d524e4850651cfedd64bc0740f1379b533f607d/Formula/thrift.rb
即可。
安装成功。
源码安装
开始爬坑
安装前要求工具 可以使用brew install 进行安装
https://thrift.apache.org/docs/install/os_x
boost
libevent
openssl
bison 2.5下载thrift文件安装包
https://github.com/apache/thrift/releases/tag/0.9.3
tar -zxvf 解压编译流程
./configure –prefix=/usr/local/ –disable-static –without-python –without-csharp –without-ruby –without-perl –without-php –without-haskell –without-erlang
https://thrift.apache.org/docs/BuildingFromSource
出现bison版本低: https://stackoverflow.com/questions/31805431/how-to-install-bison-on-mac-osx
注意需要source .base_profile出现问题:
src/thrift/transport/TSSLSocket.cpp:33:10: fatal error: ‘openssl/err.h’ file not found #include <openssl/err.h>
https://www.jianshu.com/p/f7380139afdd
推荐阅读:
编译器的工作过程